# A Google Command Line Program
# Spelling request class and functions
# Copyright (C) 2005 by Deryck Hodge
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.


from libgcli.search import Service

class SpellRequest(Service):
    """ Spelling requests are called by (key, word).  Words are passed
        in here as Service.params.

        Example:
            p = Params()
            p.query = WORD
            suggestion = SpellRequest(p).suggest()
    """

    def __init__(self, params):
        Service.__init__(self, params)
        self.suggestion = self.connection.doSpellingSuggestion(params.key, params.query)

    def suggest(self):
        return self.suggestion

